package com.jxtti.utils;

import org.apache.log4j.Logger;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

public class DynamicDataSource extends AbstractRoutingDataSource{
	static Logger log = Logger.getLogger("DynamicDataSource");  
	 @Override 
	 protected Object determineCurrentLookupKey() {  
		 // 在进行DAO操作前，通过上下文环境变量，获得数据源的类型  
		 return DbContextHolder.getDbType();  
	 }  
}
 